module.exports = (sequelize, DataTypes) => {
  const userAuth = sequelize.define('userAuth', {
    identityType: DataTypes.STRING(15),
    identifier: DataTypes.STRING(70),
    credential: DataTypes.STRING(100),
    activited: {
      type: DataTypes.BOOLEAN,
      defaultValue: false
    },
    code: DataTypes.STRING(50),
    codeDate: DataTypes.DATE,
    disable: {
      type: DataTypes.BOOLEAN,
      defaultValue: false
    }
  })

  // userAuth.associate = (models) => {
  //   userAuth.belongsTo(models.shop, {
  //     foreignKey: 'uuId',
  //     targetKey: 'shopId',
  //     as: 'shop'
  //   })
  //   userAuth.belongsTo(models.user, {
  //     foreignKey: 'uuId',
  //     targetKey: 'userId',
  //     as: 'user'
  //   })
  // }
  return userAuth
}
